# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-multiurl
_pkgorig=multiurl
pkgver=0.3.2
pkgrel=0
pkgdesc="A package to download several URL as one, as well as supporting multi-part URLs"
url="https://github.com/ecmwf/multiurl"
arch="noarch"
license="Apache-2.0"
depends="py3-dateutil py3-tqdm py3-tz py3-requests"
makedepends="py3-gpep517 py3-setuptools_scm py3-wheel"
checkdepends="py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/m/multiurl/multiurl-$pkgver.tar.gz"
builddir="$srcdir/$_pkgorig-$pkgver"
options="!check" # several tests fail | they are not updated

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n auto
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
e0017fe738ebbb1da0b136679de7cde1cd4da6d51fd804ef6be3888fc6320cbca620bf67c4b9b0ab2dde75d843e76ddfda6f8cd3194f440146acfb8efbe37f8e  py3-multiurl-0.3.2.tar.gz
"
